<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
        <html>
            <head>
              <title>Xml Logger</title>
              <link rel="stylesheet" href="LoggingXSLTFiles\logging.css" />
              <script language="javascript">
                function outliner (btn)
                {
                var trErrorDetails = document.getElementById(btn.attributes["trErrorDetailsId"].nodeValue);
                if (trErrorDetails.style.display =="none")
                {
                trErrorDetails.style.display = "";
                btn.src = "LoggingXSLTFiles/minus.gif";
                }
                else
                {
                trErrorDetails.style.display = "none";
                btn.src = "LoggingXSLTFiles/plus.gif";
                }
                }


              </script>

            </head>
            <body>


              <!-- We are using only details of log 
                <p class="heading">EXtremecode Logger</p>
                <p>
                    <table class="table-main" >
                        <tr align="center">
                            <td  class="table-row">Normal</td>
                        </tr>
                        <tr align="center">
                            <td class="table-row-error">Error</td>
                        </tr>
                        <tr align="center">
                            <td class="table-framework-row">Framework</td>
                        </tr>
                        <tr align="center">
                            <td class="table-framework-row-error">Framework Error</td>
                        </tr>
                    </table>
                    <table height="50">
                    </table>
                </p> -->


              <table class="table-main" width ="100%" border="0" cellspacing="1" cellpadding="3">
                    <!-- MSTableType="layout" -->
                    <!-- fpstyle: 34,011111100 -->
                  <tr>
                    <td colspan ="5">
                      <img src ="LoggingXSLTFiles/logo.png" border ="0" />
                    </td>  
					<td  colspan ="2" align="right" style="width:45%;padding-left:20;vertical-align:bottom" >
						<a href="http://eXtremecodeworld.blogspot.com">http://eXtremecodeworld.blogspot.com</a>
					</td>
                  </tr>  
                  <tr class="table-header">
                        <td colspan="2">Time</td>
                        <td>Assembly</td>
                        <td>Class</td>
                        <td>Method</td>
                        <td>Message</td>
                        <td>Error</td>
                    </tr>

                    <xsl:for-each select="logging/log">

                      <xsl:sort select="@loggingTime" order="descending"/>
                      <xsl:sort select="@order" order="descending"/>
                      <xsl:sort select="@assembly" order="ascending"/>
                      <xsl:sort select="@className" order="ascending"/>
                      <xsl:sort select="@method" order="ascending"/>
                      <xsl:variable name="idDetailsTR" select="concat('detailsTR',generate-id(.))"/>
                        <!--All-->
                        <xsl:if test="1=1">
                        
                        <!--Error Logging-->
                        <!--<xsl:if test="@isError='true'">-->
                        
                        <!--tag-->
                        <!--<xsl:if test="@tag='test'">-->

                        <tr>
                              <xsl:attribute name="class">
                                <xsl:choose>
                                  <xsl:when test="@isError='true'">
                                  <xsl:value-of select="concat(@css,'-error')"/>
                                  </xsl:when>
                                  <xsl:otherwise>
                                    <xsl:value-of select="@css"/>
                                  </xsl:otherwise>
                                </xsl:choose>
                              </xsl:attribute>  
                              <td width="1" >
                                <img src="LoggingXSLTFiles/plus.gif" border="0" width="9" height="11" onclick="outliner(this)">
                                  <xsl:attribute name="trErrorDetailsId">
                                    <xsl:value-of select="$idDetailsTR"/>
                                  </xsl:attribute>
                                  <xsl:if test="@errorDetails = ''">
                                    <xsl:attribute name="style">
                                      display:none
                                    </xsl:attribute>
                                  </xsl:if>
                                </img>
                              </td>
                            <td><xsl:value-of select="@loggingTime"/></td>
                              <td><xsl:value-of select="@assembly"/></td>
                              <td><xsl:value-of select="@className"/></td>
                              <td><xsl:value-of select="@method"/></td>
                              <td><xsl:value-of select="@message"/></td>
                              <td><xsl:value-of select="@errorMessage"/></td>
                        </tr>
                        <tr style="display:none;">
                          <xsl:attribute name="id">
                            <xsl:value-of select="$idDetailsTR"/>
                          </xsl:attribute>
                          <xsl:attribute name="class">
                            <xsl:choose>
                              <xsl:when test="@isError='true'">
                                <xsl:value-of select="concat(@css,'-error')"/>
                              </xsl:when>
                              <xsl:otherwise>
                                <xsl:value-of select="@css"/>
                              </xsl:otherwise>
                            </xsl:choose>
                          </xsl:attribute>
                          <td colspan ="7">
                            <pre cols="160" rows="5" readonly="true" style="border-style: none;font: 9pt 'Courier New', Courier, mono;white-space:pre;overflow:auto;">
                              <xsl:attribute name="class">
                                <xsl:choose>
                                  <xsl:when test="@isError='true'">
                                    <xsl:value-of select="concat(@css,'-error')"/>
                                  </xsl:when>
                                  <xsl:otherwise>
                                    <xsl:value-of select="@css"/>
                                  </xsl:otherwise>
                                </xsl:choose>
                              </xsl:attribute>
                              <xsl:value-of select="@errorDetails"/>
                            </pre> 
                          </td>
                        </tr>  
                           
                        </xsl:if>
                    </xsl:for-each>
                <tr class="table-header">
                  <td colspan="2">Time</td>
                  <td>Assembly</td>
                  <td>Class</td>
                  <td>Medhod</td>
                  <td>Message</td>
                  <td>Error</td>
                </tr>
                </table>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet> 
